package cms.web.html;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.ArrayUtils;

@AllArgsConstructor
@Getter
public enum HtmlTypeEnum {
    IMAGE("图片"),FLASH("FLASH"),MEDIA("音频"),MAP("地图"), FILE("文件"),ALL("全部");
    String desc;

    /**
     * 是否包含
     * @param typeEnums
     * @param anEnum
     * @return
     */
    public static boolean contains(HtmlTypeEnum[] typeEnums, HtmlTypeEnum anEnum) {
        if(ArrayUtils.isNotEmpty(typeEnums)){
            for(HtmlTypeEnum typeEnum:typeEnums){
                if(ALL.equals(typeEnum) || typeEnum.equals(anEnum)){
                    return true;
                }
            }
        }
        return false;
    }
}
